home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_4.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  1.4 KB  |  42 lines

  1. global gVoid
  2.  
  3. on FindSpriteProp maxSprite, propsToCheck, propToFind
  4.   repeat with whichSprite = 1 to maxSprite
  5.     if count(the scriptInstanceList of sprite whichSprite) then
  6.       repeat with n = 1 to count(propsToCheck)
  7.         set inputPropertyValue to getAt(propsToCheck, n)
  8.         set propertyValueOfSprite to getaProp(sprite(whichSprite), getPropAt(propsToCheck, n))
  9.         if not (inputPropertyValue = propertyValueOfSprite) then
  10.           exit repeat
  11.         end if
  12.       end repeat
  13.       if n > count(propsToCheck) then
  14.         set propFound to getaProp(sprite(whichSprite), propToFind)
  15.         if not voidp(propFound) then
  16.           return propFound
  17.         end if
  18.       end if
  19.     end if
  20.   end repeat
  21.   return gVoid
  22. end
  23.  
  24. on SetSpriteProp maxSprite, propsToCheck, propToSet
  25.   repeat with whichSprite = 1 to maxSprite
  26.     if count(the scriptInstanceList of sprite whichSprite) then
  27.       repeat with n = 1 to count(propsToCheck)
  28.         set inputPropertyValue to getAt(propsToCheck, n)
  29.         set propertyValueOfSprite to getaProp(sprite(whichSprite), getPropAt(propsToCheck, n))
  30.         if not (inputPropertyValue = propertyValueOfSprite) then
  31.           exit repeat
  32.         end if
  33.       end repeat
  34.       if n > count(propsToCheck) then
  35.         set property to getAt(propToSet, 1)
  36.         set propertyValue to getAt(propToSet, 2)
  37.         setaProp(sprite(whichSprite), property, propertyValue)
  38.       end if
  39.     end if
  40.   end repeat
  41. end
  42.